package com.mall.db.dao;

import com.mall.db.domain.JobAndTrigger;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface JobDao {

@Select({"<script>\n"+"SELECT\n" +
        "d.JOB_NAME,d.JOB_GROUP,d.JOB_CLASS_NAME class_name,\n" +
        "t.TRIGGER_GROUP,t.TRIGGER_NAME,t.TRIGGER_STATE state,\n" +
        "c.CRON_EXPRESSION corn,c.TIME_ZONE_ID time_zone\n" +
        "FROM qrtz_job_details d\n" +
        "join qrtz_triggers t\n" +
        "JOIN qrtz_cron_triggers c\n" +
        "on d.JOB_NAME=t.JOB_NAME and t.TRIGGER_NAME=c.TRIGGER_NAME\n" +
        "and t.TRIGGER_GROUP=c.TRIGGER_GROUP where 1=1 \n"+
        "<if test='jobName!=null'> and d.job_name=#{jobName}</if> \n"+
        "</script>"})
    List<JobAndTrigger> find(JobAndTrigger jt);
}
